import datetime
from Utils import Utils

class WorkRecord:
    def __init__(self,workDate,startTime="",endTime=""):
        self.workDate = workDate
        self.startTime = startTime
        self.endTime = endTime
        self.startTimeWithDate = self.getStartTimeWithDate()
        self.endTimeWithDate = self.getEndTimeWithDate()

    def getStartTimeWithDate(self):
        if len(self.startTime)>0:
            return Utils.formatTime(self.workDate + " " + self.startTime)
        return None

    def getEndTimeWithDate(self):
        if len(self.endTime)>0:
            return Utils.formatTime(self.workDate + " " + self.endTime)
        return None

    def hasStartTime(self):
        return True if len(self.startTime)>0 else False



    def hasEndTime(self):
        return True if len(self.endTime)>0 else False






if __name__ == '__main__':
    workRecord = WorkRecord("2016/08/01","","21:01:00")
    pass